It is common for threads to become serialized with processes to read entire directories within a storage system. In general, such a read operation from a directory, e.g., a “/home” directory, involves an operating system, a file system, and a memory component that stores the /home directory. The operating system provides a buffer and transmits an offset along with the read request to the file system. The file system, based on the offset, reads a data block stored in the /home directory. The file system writes the read data into the buffer and updates the offset value.
The operating system receives the updated offset value and transmits the updated offset value along another serial read request. The file system, based on the updated offset value, reads another data block from the /home directory and writes the read data into the buffer. This process continues until all the desired data is read from the directory once and only once.
One type of conventional serialized process places a shared lock on the directory being read; therefore, other processes are not able to use the directory while the lock is in place. This is not efficient. Increased computer usage and the Internet have led to an increase in content sharing including sharing files within directories. In other words, files within a directory may be accessed by one or more users, applications, clients, etc., simultaneously or serially. Unfortunately, exclusive access requests to files within the /home directory prevent the data from being shared with other types of requests.
Partitioning a directory helps to increase efficiency by allowing some partitions of the directory to be shared while others are being exclusively accessed. In order to accommodate exclusive access requests as well as other types of requests simultaneously, a directory may be partitioned. For example, the /home directory may be partitioned into additional subdirectories in order to facilitate multiple exclusive accesses simultaneously.
Unfortunately, if the directory is partitioned during a read operation, then an entry may be read twice due to the shuffling of the entries associated with the partitioning. Therefore, while partitioning of a directory may improve directory accessibility incident to a serialized process, it has the disadvantage of potentially missing a file in the read operation (e.g., a readdir operation) or reading a file more than once and reporting it more than once to the operating system. Thus, conventionally, partitioning is prevented from occurring during the execution of a serialized process such as a readdir operation. However, this can negatively impact the file system's performance because, as noted above, partitioning can increase efficiency.